﻿using System;
using System.ComponentModel;
using System.Reflection;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdEdBaseIO : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdEdBaseIO(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdEdBaseIO_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdEdBaseIO obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdEdBaseIO()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdEdBaseIO(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdEdBaseIO() : this(GlobalsPINVOKE.new_OdEdBaseIO(), MemoryManager.GetMemoryManager().GetCurrentTransaction() == null)
		{
			MemoryTransaction currentTransaction = MemoryManager.GetMemoryManager().GetCurrentTransaction();
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(new OdEdBaseIO(this.swigCPtr.Handle, true));
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			this.SwigDirectorConnect();
		}

		public virtual string getString(string prompt, int options, OdEdStringTracker pTracker)
		{
			string result = GlobalsPINVOKE.OdEdBaseIO_getString__SWIG_0(this.swigCPtr, prompt, options, OdEdStringTracker.getCPtr(pTracker));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string getString(string prompt, int options)
		{
			string result = GlobalsPINVOKE.OdEdBaseIO_getString__SWIG_1(this.swigCPtr, prompt, options);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string getString(string prompt)
		{
			string result = GlobalsPINVOKE.OdEdBaseIO_getString__SWIG_2(this.swigCPtr, prompt);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void putString(string arg0)
		{
			GlobalsPINVOKE.OdEdBaseIO_putString(this.swigCPtr, arg0);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdGePoint3d getPoint(string prompt, int options, OdEdPointTracker pTracker)
		{
			OdGePoint3d result = new OdGePoint3d(this.SwigDerivedClassHasMethod("getPoint", OdEdBaseIO.swigMethodTypes6) ? GlobalsPINVOKE.OdEdBaseIO_getPointSwigExplicitOdEdBaseIO__SWIG_0(this.swigCPtr, prompt, options, OdEdPointTracker.getCPtr(pTracker)) : GlobalsPINVOKE.OdEdBaseIO_getPoint__SWIG_0(this.swigCPtr, prompt, options, OdEdPointTracker.getCPtr(pTracker)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGePoint3d getPoint(string prompt, int options)
		{
			OdGePoint3d result = new OdGePoint3d(this.SwigDerivedClassHasMethod("getPoint", OdEdBaseIO.swigMethodTypes7) ? GlobalsPINVOKE.OdEdBaseIO_getPointSwigExplicitOdEdBaseIO__SWIG_1(this.swigCPtr, prompt, options) : GlobalsPINVOKE.OdEdBaseIO_getPoint__SWIG_1(this.swigCPtr, prompt, options), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGePoint3d getPoint(string prompt)
		{
			OdGePoint3d result = new OdGePoint3d(this.SwigDerivedClassHasMethod("getPoint", OdEdBaseIO.swigMethodTypes8) ? GlobalsPINVOKE.OdEdBaseIO_getPointSwigExplicitOdEdBaseIO__SWIG_2(this.swigCPtr, prompt) : GlobalsPINVOKE.OdEdBaseIO_getPoint__SWIG_2(this.swigCPtr, prompt), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual uint getKeyState()
		{
			uint result = this.SwigDerivedClassHasMethod("getKeyState", OdEdBaseIO.swigMethodTypes9) ? GlobalsPINVOKE.OdEdBaseIO_getKeyStateSwigExplicitOdEdBaseIO(this.swigCPtr) : GlobalsPINVOKE.OdEdBaseIO_getKeyState(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void putError(string errmsg)
		{
			if (this.SwigDerivedClassHasMethod("putError", OdEdBaseIO.swigMethodTypes10))
			{
				GlobalsPINVOKE.OdEdBaseIO_putErrorSwigExplicitOdEdBaseIO(this.swigCPtr, errmsg);
			}
			else
			{
				GlobalsPINVOKE.OdEdBaseIO_putError(this.swigCPtr, errmsg);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private void SwigDirectorConnect()
		{
			if (this.SwigDerivedClassHasMethod("queryX", OdEdBaseIO.swigMethodTypes0))
			{
				this.swigDelegate0 = new OdEdBaseIO.SwigDelegateOdEdBaseIO_0(this.SwigDirectorqueryX);
			}
			if (this.SwigDerivedClassHasMethod("isA", OdEdBaseIO.swigMethodTypes1))
			{
				this.swigDelegate1 = new OdEdBaseIO.SwigDelegateOdEdBaseIO_1(this.SwigDirectorisA);
			}
			if (this.SwigDerivedClassHasMethod("getString", OdEdBaseIO.swigMethodTypes2))
			{
				this.swigDelegate2 = new OdEdBaseIO.SwigDelegateOdEdBaseIO_2(this.SwigDirectorgetString__SWIG_0);
			}
			if (this.SwigDerivedClassHasMethod("getString", OdEdBaseIO.swigMethodTypes3))
			{
				this.swigDelegate3 = new OdEdBaseIO.SwigDelegateOdEdBaseIO_3(this.SwigDirectorgetString__SWIG_1);
			}
			if (this.SwigDerivedClassHasMethod("getString", OdEdBaseIO.swigMethodTypes4))
			{
				this.swigDelegate4 = new OdEdBaseIO.SwigDelegateOdEdBaseIO_4(this.SwigDirectorgetString__SWIG_2);
			}
			if (this.SwigDerivedClassHasMethod("putString", OdEdBaseIO.swigMethodTypes5))
			{
				this.swigDelegate5 = new OdEdBaseIO.SwigDelegateOdEdBaseIO_5(this.SwigDirectorputString);
			}
			if (this.SwigDerivedClassHasMethod("getPoint", OdEdBaseIO.swigMethodTypes6))
			{
				this.swigDelegate6 = new OdEdBaseIO.SwigDelegateOdEdBaseIO_6(this.SwigDirectorgetPoint__SWIG_0);
			}
			if (this.SwigDerivedClassHasMethod("getPoint", OdEdBaseIO.swigMethodTypes7))
			{
				this.swigDelegate7 = new OdEdBaseIO.SwigDelegateOdEdBaseIO_7(this.SwigDirectorgetPoint__SWIG_1);
			}
			if (this.SwigDerivedClassHasMethod("getPoint", OdEdBaseIO.swigMethodTypes8))
			{
				this.swigDelegate8 = new OdEdBaseIO.SwigDelegateOdEdBaseIO_8(this.SwigDirectorgetPoint__SWIG_2);
			}
			if (this.SwigDerivedClassHasMethod("getKeyState", OdEdBaseIO.swigMethodTypes9))
			{
				this.swigDelegate9 = new OdEdBaseIO.SwigDelegateOdEdBaseIO_9(this.SwigDirectorgetKeyState);
			}
			if (this.SwigDerivedClassHasMethod("putError", OdEdBaseIO.swigMethodTypes10))
			{
				this.swigDelegate10 = new OdEdBaseIO.SwigDelegateOdEdBaseIO_10(this.SwigDirectorputError);
			}
			GlobalsPINVOKE.OdEdBaseIO_director_connect(this.swigCPtr, this.swigDelegate0, this.swigDelegate1, this.swigDelegate2, this.swigDelegate3, this.swigDelegate4, this.swigDelegate5, this.swigDelegate6, this.swigDelegate7, this.swigDelegate8, this.swigDelegate9, this.swigDelegate10);
		}

		private bool SwigDerivedClassHasMethod(string methodName, Type[] methodTypes)
		{
			MethodInfo method = base.GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, methodTypes, null);
			return method.DeclaringType.IsSubclassOf(typeof(OdEdBaseIO));
		}

		private IntPtr SwigDirectorqueryX(IntPtr pClass)
		{
			return OdRxObject.getCPtr(this.queryX((OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(pClass, false))).Handle;
		}

		private IntPtr SwigDirectorisA()
		{
			return OdRxClass.getCPtr(this.isA()).Handle;
		}

		[return: MarshalAs(UnmanagedType.LPWStr)]
		private string SwigDirectorgetString__SWIG_0([MarshalAs(UnmanagedType.LPWStr)] string prompt, int options, IntPtr pTracker)
		{
			return this.getString(prompt, options, (OdEdStringTracker)Teigha.Core.Helpers.odrxCreateObjectInternal(pTracker, false));
		}

		[return: MarshalAs(UnmanagedType.LPWStr)]
		private string SwigDirectorgetString__SWIG_1([MarshalAs(UnmanagedType.LPWStr)] string prompt, int options)
		{
			return this.getString(prompt, options);
		}

		[return: MarshalAs(UnmanagedType.LPWStr)]
		private string SwigDirectorgetString__SWIG_2([MarshalAs(UnmanagedType.LPWStr)] string prompt)
		{
			return this.getString(prompt);
		}

		private void SwigDirectorputString([MarshalAs(UnmanagedType.LPWStr)] string arg0)
		{
			this.putString(arg0);
		}

		private IntPtr SwigDirectorgetPoint__SWIG_0([MarshalAs(UnmanagedType.LPWStr)] string prompt, int options, IntPtr pTracker)
		{
			return OdGePoint3d.getCPtr(this.getPoint(prompt, options, (OdEdPointTracker)Teigha.Core.Helpers.odrxCreateObjectInternal(pTracker, false))).Handle;
		}

		private IntPtr SwigDirectorgetPoint__SWIG_1([MarshalAs(UnmanagedType.LPWStr)] string prompt, int options)
		{
			return OdGePoint3d.getCPtr(this.getPoint(prompt, options)).Handle;
		}

		private IntPtr SwigDirectorgetPoint__SWIG_2([MarshalAs(UnmanagedType.LPWStr)] string prompt)
		{
			return OdGePoint3d.getCPtr(this.getPoint(prompt)).Handle;
		}

		private uint SwigDirectorgetKeyState()
		{
			return this.getKeyState();
		}

		private void SwigDirectorputError([MarshalAs(UnmanagedType.LPWStr)] string errmsg)
		{
			this.putError(errmsg);
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		private OdEdBaseIO.SwigDelegateOdEdBaseIO_0 swigDelegate0;

		private OdEdBaseIO.SwigDelegateOdEdBaseIO_1 swigDelegate1;

		private OdEdBaseIO.SwigDelegateOdEdBaseIO_2 swigDelegate2;

		private OdEdBaseIO.SwigDelegateOdEdBaseIO_3 swigDelegate3;

		private OdEdBaseIO.SwigDelegateOdEdBaseIO_4 swigDelegate4;

		private OdEdBaseIO.SwigDelegateOdEdBaseIO_5 swigDelegate5;

		private OdEdBaseIO.SwigDelegateOdEdBaseIO_6 swigDelegate6;

		private OdEdBaseIO.SwigDelegateOdEdBaseIO_7 swigDelegate7;

		private OdEdBaseIO.SwigDelegateOdEdBaseIO_8 swigDelegate8;

		private OdEdBaseIO.SwigDelegateOdEdBaseIO_9 swigDelegate9;

		private OdEdBaseIO.SwigDelegateOdEdBaseIO_10 swigDelegate10;

		private static Type[] swigMethodTypes0 = new Type[]
		{
			typeof(OdRxClass)
		};

		private static Type[] swigMethodTypes1 = new Type[0];

		private static Type[] swigMethodTypes2 = new Type[]
		{
			typeof(string),
			typeof(int),
			typeof(OdEdStringTracker)
		};

		private static Type[] swigMethodTypes3 = new Type[]
		{
			typeof(string),
			typeof(int)
		};

		private static Type[] swigMethodTypes4 = new Type[]
		{
			typeof(string)
		};

		private static Type[] swigMethodTypes5 = new Type[]
		{
			typeof(string)
		};

		private static Type[] swigMethodTypes6 = new Type[]
		{
			typeof(string),
			typeof(int),
			typeof(OdEdPointTracker)
		};

		private static Type[] swigMethodTypes7 = new Type[]
		{
			typeof(string),
			typeof(int)
		};

		private static Type[] swigMethodTypes8 = new Type[]
		{
			typeof(string)
		};

		private static Type[] swigMethodTypes9 = new Type[0];

		private static Type[] swigMethodTypes10 = new Type[]
		{
			typeof(string)
		};

		public delegate IntPtr SwigDelegateOdEdBaseIO_0(IntPtr pClass);

		public delegate IntPtr SwigDelegateOdEdBaseIO_1();

		[return: MarshalAs(UnmanagedType.LPWStr)]
		public delegate string SwigDelegateOdEdBaseIO_2([MarshalAs(UnmanagedType.LPWStr)] string prompt, int options, IntPtr pTracker);

		[return: MarshalAs(UnmanagedType.LPWStr)]
		public delegate string SwigDelegateOdEdBaseIO_3([MarshalAs(UnmanagedType.LPWStr)] string prompt, int options);

		[return: MarshalAs(UnmanagedType.LPWStr)]
		public delegate string SwigDelegateOdEdBaseIO_4([MarshalAs(UnmanagedType.LPWStr)] string prompt);

		public delegate void SwigDelegateOdEdBaseIO_5([MarshalAs(UnmanagedType.LPWStr)] string arg0);

		public delegate IntPtr SwigDelegateOdEdBaseIO_6([MarshalAs(UnmanagedType.LPWStr)] string prompt, int options, IntPtr pTracker);

		public delegate IntPtr SwigDelegateOdEdBaseIO_7([MarshalAs(UnmanagedType.LPWStr)] string prompt, int options);

		public delegate IntPtr SwigDelegateOdEdBaseIO_8([MarshalAs(UnmanagedType.LPWStr)] string prompt);

		public delegate uint SwigDelegateOdEdBaseIO_9();

		public delegate void SwigDelegateOdEdBaseIO_10([MarshalAs(UnmanagedType.LPWStr)] string errmsg);

		public enum MouseEventFlags
		{
			kLeftButtonIsDown = 1,
			kRightButtonIsDown,
			kShiftIsDown = 4,
			kControlIsDown = 8,
			kMiddleButtonIsDown = 16
		}
	}
}
